package com.sunxd.zstudy.java8.lambda;

/**
 * @author sun.xd
 * @description: description
 * @date 2023/11/14 16:05
 */
public class T03 {
    public static void main(String[] args) {

        Thread t1 = new Thread(new MyRunnable());
        t1.start();

        // 匿名内部类
        Thread t2 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println(2);
            }
        });

        // lambda表达式
        Thread t3 = new Thread(() -> {
            System.out.println(3);
        });
        t3.start();
    }

    static class MyRunnable implements Runnable{

        @Override
        public void run() {
            System.out.println("1");
        }
    }
}
